package com.boot.unity.api.constants;

import org.apache.commons.lang3.StringUtils;

public enum EncryptEnum {
    E1("e1","SHA1"),
    E2("e2","SHA256"),
    E3("e3","SHA512");

    private String type;
    private String encrypt;

    EncryptEnum(String type, String encrypt) {
        this.type = type;
        this.encrypt = encrypt;
    }

    public static EncryptEnum getEncryptType(String type){
        if (StringUtils.isBlank(type)){
            return null;
        }
        for (EncryptEnum e : EncryptEnum.values()){
            if (e.type.equals(type)){
                return e;
            }
        }
        return null;
    }
}
